<template>
	<div class="channel">
		<second-nav :tid="Parent_tid"  v-on:PchangeTid="changeTid"></second-nav>
		<bcontents :tid="Parent_tid"  v-on:PchangeTid="changeTid"></bcontents>
		<bfooter></bfooter>
	</div>
</template>

<script>
	import secondNav from "components/secondNav";
	import bcontents from "components/contents";
	import bfooter from "components/footer";
	export default{
		components:{
			secondNav,
			bcontents,
			bfooter
		},
		data(){
			return {
				Parent_tid:this.$route.params.tid
			}
		},
		methods:{
			changeTid(tid){
				this.Parent_tid = tid;
			}
		},
		watch:{
			$route(newValue,oldValue){
				if(newValue.path.indexOf("channel")){
					this.$store.commit("setCurTid",{
						curTid:newValue.params.tid
					})
					this.Parent_tid=newValue.params.tid
				}
			}
		}
	}
</script>

<style lang="scss">
	.channel{
		position: relative;
	}
</style>